<template>
    <hsa-dialog v-model:visible="isVisible" title="分享">
      <el-form label-width="100px">
        <el-form-item label="分享类型">
          <el-radio-group v-model="shareType">
            <el-radio label="用户">用户</el-radio>
            <el-radio label="团队">团队</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="用户/团队">
          <el-select v-model="selectedUserOrTeam" placeholder="请选择">
            <el-option label="选项 1" value="option1"></el-option>
            <el-option label="选项 2" value="option2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="授权权限">
          <el-radio-group v-model="authorization">
            <el-radio label="授权使用">授权使用</el-radio>
            <el-radio label="授权编辑">授权编辑</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="closeModal">取消</el-button>
        <el-button type="primary" @click="confirmShare">确认</el-button>
      </template>
    </hsa-dialog>
  </template>
  
  <script setup lang="ts">
  import { ref } from 'vue';
  
  const isVisible = ref(false);
  const shareType = ref('');
  const selectedUserOrTeam = ref('');
  const authorization = ref('');
  
  const open = () => {
    isVisible.value = true;
  };
  
  const closeModal = () => {
    isVisible.value = false;
  };
  
  const confirmShare = () => {
    console.log('确认分享操作，分享类型:', shareType.value, '用户/团队:', selectedUserOrTeam.value, '授权权限:', authorization.value);
    closeModal();
  };
  
  defineExpose({
    open
  });
  </script>